package com.sunfield.baseframe.base;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by wangxl on 2016/8/17.
 */
public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<? extends BaseFragment> fragmentList;

    public MyFragmentPagerAdapter(FragmentManager fm, List<? extends BaseFragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public BaseFragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList == null ? 0 : fragmentList.size();
    }

}
